package com.jzx.provider.cv.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author daihuihui
 * @date 2019/2/2
 */
@AllArgsConstructor
public enum MaritalStatus {
    /**
     * 未婚
     */
    UNMARRIED(1,"未婚"),

    /**
     * 已婚
     */
    MARRIED(2,"已婚"),

    /**
     * 离婚
     */
    DIVORCED(3,"离婚"),

    /**
     * 丧偶
     */
    LOST(4,"丧偶");

    @Getter
    private Integer value;

    @Getter
    private String name;

    public static String getByValue(Integer val) {
        for (Education education : Education.values()) {
            if (education.getValue().equals(val)) {
                return education.getName();
            }
        }
        return null;
    }
}
